<template>
  <div style="border: 1px solid red">
    组件1
    <p>
      {{num}}
      <input type="text" placeholder="">
    </p>
    <p>
      <input type="text" v-model="new_num">
    </p>
    <button @click="yaotang">yaotang</button>
  </div>
</template>

<script>
  export default {
    name: "comp1",
    props: ['num'],  // 只读
    data(){
      return {
        new_num:''
      }
    },
    methods: {
      yaotang() {
        this.$emit('yaotang', this.new_num)
        // debugger
        this.$parent.geitang(this.new_num)
      }
    }
  }
</script>

<style scoped>

</style>